package com.xm3.filter;

import java.sql.SQLException;

import com.xm.utils.DBManager;
import com.xm.utils.QueryDataResult;
import com.xm3.entity.guanlibd;

public class cz {
       public static guanlibd queryByName(String xm) {
		String sql ="select * from guanlibd where name='"+xm+"'";
		QueryDataResult qdr= DBManager.executeQuery(sql);
		guanlibd u=null;
		if(qdr.rs!=null) {
			try {
				while(qdr.rs.next()) {
					int id=qdr.rs.getInt("id");
					String name=qdr.rs.getString("name");
					String password=qdr.rs.getString("password");
					 u=new guanlibd(id,name,password);
				}
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		qdr.close();
		return u;
       }
}
